﻿using System;
using System.Linq;
using System.Web.Mvc;
using MiniWeb.Core.Entities;
using MiniWeb.Task;
using MiniWeb.Web.Controllers.Admin.OrdersDetailManager.ViewModels;
using WFramework.Mappers;
using WFramework.MvcPager;
using WFramework;
using System.Collections.Generic;
namespace MiniWeb.Web.Controllers.Admin.OrdersDetailManager
{

    public class OrdersDetailManagerController : BaseController
    {
        private readonly OrdersDetailTask _ordersdetailTask = new OrdersDetailTask();

        public ActionResult List(int pageIndex = 1, int pageSize = 20)
        {
            var pagedList = _ordersdetailTask.GetPagedList(pageIndex, pageSize);



            var model = new PagedList<OrdersDetail>(pagedList.ToList(), pageIndex, pageSize, pagedList.TotalItemCount);

            return View(model);
        }

        #region 删除用户信息 Delete

        [HttpPost]
        public void Delete(int id)
        {
            _ordersdetailTask.Delete(id);
        }

        #endregion
    }
}